<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>Insert title here</title>
	</head>
	<body>
	性别：<input type="radio" name="gender" value="nan">男
		 <input type="radio" name="gender" value="nv">女
		 <h1 class="c1" id="myh1">这是h1</h1>
		 <div class="c1">这是div1</div>
		 
		 
		<script type="text/javascript">
			//只执行一次
			setTimeout(function(){
				//alert("啦啦啦啦");
				var arr = document.getElementsByName("gender");
				for(var i=0;i<arr.length;i++){
					if(arr[i].checked){
						alert(arr[i].value);
				}
			}
		},3000);
		</script>
	</body>
</html>